package com.rao.gmall.web.all.service.impl;

import com.rao.gmall.common.cache.BloomName;
import com.rao.gmall.common.cache.GmallCache;
import com.rao.gmall.feign.product.CategoryFeignClient;
import com.rao.gmall.model.vo.IndexCategoryVo;
import com.rao.gmall.web.all.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author nzmxfan
 * @create 2021-08-12-23:18
 */
@Service
public class IndexServiceImpl implements IndexService {


    @Autowired
    CategoryFeignClient categoryFeignClient;

    @GmallCache(
            cacheKeyExpr = "index:category:#{#method.getName()}",
            enableBloom = false,
            ttl = 60 * 60 * 1000 * 24 * 7
    )
    @Override
    public List<IndexCategoryVo> getAllCategorysForIndexHtml() {
        return categoryFeignClient.getAllCategorysForIndexHtml();
    }
}
